import 'package:flutter/material.dart';

/// @author longzipeng
/// @创建时间：2022/3/30
/// 公共的appbar
class CommonAppbar extends StatefulWidget  implements PreferredSizeWidget{
  final String title;

  const CommonAppbar({Key? key, this.title = "演示"}) : super(key: key);

  @override
  State<CommonAppbar> createState() => _CommonAppbarState();

  @override
  Size get preferredSize => new Size.fromHeight(50);
}

class _CommonAppbarState extends State<CommonAppbar> {
  @override
  Widget build(BuildContext context) {
    return AppBar(
      title: Text(widget.title),
      centerTitle: true,
    );
  }
}
